<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png" />
    <el-button> 测试一下呀</el-button>

    <H-table
      v-model="pageRequest.pageNum"
      :pageSize.sync="pageRequest.pageSize"
      :data="tableData"
      :columns="columns"
      @getPageList="fetchList"
      :isPagination="false"
      :total="total"
    >
      <template slot="oper">
        <el-button type="text">4444</el-button>
      </template>
    </H-table>
    <H-button>5</H-button>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: 'Home',
  components: {},
  data() {
    return {
      pageRequest: { pageNum: 1, pageSize: 20 },
      tableData: [],
      loading: false,
      total: 10,
      columns: [
        {
          label: '菜单名称',
          prop: 'resourceName',
          align: 'left',
          width: '225',
        },
        {
          label: '类型',
          prop: 'type',
          align: 'left',
          width: '120',
        },
        {
          label: '应用名称',
          prop: 'appName',
          align: 'left',
        },
        {
          label: '操作',
          slot: 'oper',
        },
      ],
    }
  },
  mounted() {
    this.fetchList()
  },
  methods: {
    // 列表接口方法
    fetchList() {
      this.tableData = [
        {
          id: 75,
          resourceName: '测试跳转直播',
          status: 1,
          type: 3,
          createTime: 1618450467,
          modifyTime: 1619147819,
          createUser: 'a',
          modifyUser: 'w',
          createTimeString: '2021-04-15 09:34:27',
          modifyTimeString: '2021-04-23 11:16:59',
        },
        {
          id: 74,
          resourceName: 'huichang',
          status: 0,
          type: 3,
          createTime: 1617953708,
          modifyTime: 1618465872,
          createUser: 'wanglan',
          modifyUser: 'wanglan',
          createTimeString: '2021-04-09 15:35:08',
          modifyTimeString: '2021-04-15 13:51:12',
        },
      ]
    },
  },
}
</script>
